//package com.example.springboot.RabbitMQ.BasicOperation;
//
//import com.rabbitmq.client.BuiltinExchangeType;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
////Direct 直连交换机是最基本的交换机类型，它根据完全匹配的路由键（Routing Key）将消息路由到绑定的队列。
////应用场景：适合一对一的消息传递，例如日志处理、任务分发等。
////绑定规则：使用完全匹配的绑定键。
//
//@Component
//public class DirectDome {
//
//    @Autowired
//    private BasicOperation basicOperation;
//
//    private static String exchangeName = "exchange_Direct_01";
//    private static String queueName_01 = "queue_Direct_01";
//    private static String queueName_02 = "queue_Direct_02";
//    private static String routingKey_01 = "routingKey_Direct_01";
//    private static String routingKey_02 = "routingKey_Direct_02";
//    private static BuiltinExchangeType builtinExchangeType = BuiltinExchangeType.DIRECT;
//
//    public void builder() throws IOException {
//
//        basicOperation.createExchange(exchangeName,builtinExchangeType,true,false,null);
//
//        basicOperation.createQueue(queueName_01,true,false,false,null);
//        basicOperation.createQueue(queueName_02,true,false,false,null);
//
//        basicOperation.queueBind(queueName_01,exchangeName,routingKey_01);
//        basicOperation.queueBind(queueName_02,exchangeName,routingKey_02);
//
//    }
//
//    public void sendMsg() throws IOException {
//
//        String message_01 = "Hello queue_01";
//        String message_02 = "Hello queue_02";
//
//        basicOperation.sendMsg(exchangeName,routingKey_01,null,message_01);
//        basicOperation.sendMsg(exchangeName,routingKey_02,null,message_02);
//    }
//
//    public void receiveMsg() throws IOException {
//
//        basicOperation.receiveMsg(queueName_01);
//        basicOperation.receiveMsg(queueName_02);
//
//    }
//
//
//
//}
